import router from './router'
import store from './store'
router.beforeEach((to, from, next) => {
  if (to.meta.permission) {
    if (store.getters.token) {
      next()
    } else {
      next({ path: '/login' })
    }
  } else {
    next()
  }
})
